package acm.蓝桥02;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;
import java.util.ArrayList;
import java.util.List;

//方案1：模拟
//方案2：找到所有点到其他点的路径数
public class 下两个点的路径 {
    static List<Integer>[] list;
    static boolean[] vis;
    static int s;
    static int ans;

    public static void main(String[] args) {
        Reader sc = new Reader();
        int n = sc.nextInt();
        int m = sc.nextInt();
        init(n);
        for (int i = 0; i < m; i++) {
            int u = sc.nextInt();
            int v = sc.nextInt();
            add(u, v);
        }
        for (int i = 1; i < list.length; i++) {
            s = i;
            vis[s] = true;
            dfs(i, 0);
            vis[s] = false;
        }
        System.out.println(ans);
    }

    //以i点为根，找到所有距离>2的节点
    public static void dfs(int i, int d) {
        if (d > 2) {
            ans++;
            return;
        }
        for (Integer to : list[i]) {
            if (!vis[to]) {
                vis[to] = true;
                dfs(to, d + 1);
                vis[to] = false;
            }else if (to==s&&d>=2){
                ans++;
            }
        }
    }

    public static void add(int u, int v) {
        list[u].add(v);
        list[v].add(u);
    }

    public static void init(int n) {
        list = new List[n + 1];
        vis = new boolean[n + 1];
        for (int i = 1; i < list.length; i++) {
            list[i] = new ArrayList<>();
        }
    }

    static class Reader {
        private StreamTokenizer in=new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));


        public int nextInt() {
            try {
                in.nextToken();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return (int) in.nval;
        }

    }

}
